<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="icon" href="<%=$assets_server_url%>/images/favicon.ico" type="image/x-icon" />
    <title><%=yield :page_title%></title>
    <%= stylesheet_link_tag 'style', :media => 'all' %>
    <%= stylesheet_link_tag 'facebox', :media => 'all' %>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag "jquery.validate.js" %>
    <%= javascript_include_tag "tools.js" %>
    <%= javascript_include_tag "facebox.js" %>
    <%=yield :javascript_include%>
  </head>
  <body>
    <div  id="wrapper">
      <div id="head">
        <div id="logo">
          <a href="/"><%= image_tag 'logo.gif' %></a>
        </div>
        <div id="head_body">
          <div class="login_helper common_link">
            <%unless current_user.nil?%>
              <%=  link_to current_user.nickname ,user_path(current_user)%>
            <%else%>
              <%=link_to "登录",login_path%>
            <%end%>
            &nbsp;|&nbsp;
            <%unless current_user.nil?%>
              <%=link_to "注销",logout_path%>
            <%else%>
              <%=link_to "注册",signup_path%>
            <%end%>
            &nbsp;|&nbsp;<a href="javascript:;" onClick="addCookie('<%=$index_server_url%>','大满足日本语')" >加入收藏</a>
            &nbsp;|&nbsp;<a href="javascript:;" onClick="setHomepage('<%=$index_server_url%>')" >设为首页</a></span>
          </div>
          <div id="globalnav">
            <ul>
              <li class="common_link">
                <a href="#">首页</a>
              </li>
              <li class="common_link">
                <%=link_to "用户中心",user_path(current_user)%>
              </li>
              <li class="selected">
                <%=link_to "课程中心"%>
              </li>
            </ul>
          </div>
          <div class="search"></div>
        </div>
      </div>
      <div id="main_body">
        <%= yield %>
      </div>
      <%if RAILS_ENV == 'production'%>
        <%= javascript_include_tag "webanalytics.js" %>
      <%end%>
      <%= render(:partial => "common/footer")   %>
    </div>
  </body>
</html>